package com.cryrabbit.yyystitp.net;

import com.cryrabbit.yyystitp.model.Tiezi;

import java.util.List;

import retrofit2.http.POST;
import retrofit2.http.Query;
import rx.Observable;
import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

/**
 * Created by CryRabbit on 2016/11/6.
 */

public class KanHttpMethods extends BaseHttpMethods{
    private KanService service;
    public KanHttpMethods(){
        super();
        service=retrofit.create(KanService.class);
    }
    public void getNet(Subscriber<List<Tiezi>> stringSubscriber, int start, int end){
        service.getResult(start,end)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(stringSubscriber);
    }
    private interface KanService{
        @POST("tiezi/chakan")
        Observable<List<Tiezi>> getResult(@Query("start") int start, @Query("end") int end);
    }
}
